adc2mv
Converts raw Analog to Digital Converter count values to millivolts.
Contents
Syntax
Y = adc2mv(X, voltageRange, maxValue)
Description
adc2mv(X, voltageRange, maxValue) returns millivolt values corresponding to the Analog to Digital Converter Count and the voltage range set.
Example
X = [-32512 -16256 0 16256 32512];
voltageRange = 2000; % ±2 V range
maxValue = 32512;
Y = adc2mv(X, voltageRange, maxValue)
Y =
-2000 -1000 0 1000 2000
Input Arguments
- X - the raw ADC value(s), (scalar, vector or matrix)
- voltageRange - the voltage range used for the channel (positive, non-zero integer scalar value, in millivolts)
- maxValue - the maximum ADC value corresponding to the resolution for the device (positive, non-zero integer scalar value)
The units for voltageRange can be changed e.g. volts.
Output Arguments
- Y - the converted values (scalar, vector or matrix; in millivolts).
Note: If a different unit is used for the input X, then Y will have the corresponding units.
See Also
Copyright: © 2015-2019 Pico Technology Ltd. All rights reserved.